// IndexJS
define(function(require) {
	var numString = 'appEname';
	// 验证手机
	// 用法：CheckPhoneNum(phoneNumber)
	Object.prototype.CheckPhoneNum = function(num){
		var preg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
		if(!preg.test(num)){
			return false;
		}else{
			return true;
		}
	}
	// 验证密码
	// 用法：CheckPWD(password)
	Object.prototype.CheckPWD = function(pwd){
		if(pwd.length < 6){
			return false;
		}else{
			return true;
		} 
	}
	
	// 获取高度(同时有头部和尾部)
	Object.prototype.GetHeight = function(){
		var height = window.innerHeight;
		var width = window.innerWidth;
		if( width >= 600){
			var relHeight = height - 140;
		}else{
			var relHeight = height - 110;
		}	
		return relHeight;
		 
	}
	
	// 获取高度 （只有头部）
	Object.prototype.GetsingleHeight = function(){
		//var height = window.screen.height;
		var width = window.innerWidth;
		var height = window.innerHeight;
		if(width >= 600){
			var relHeight = height - 70;
		}else{
			var relHeight = height - 52;
		}
		return relHeight;
		
	}
	

	// 获取url参数
	Object.prototype.getQueryString = function (name, isURLEncode) {
	    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
	    var value = window.location.search.substr(1).match(reg);
	    if (!value) {
	        return null;
	    }
	    if (isURLEncode) {
	        return decodeURI(value[2]);
	    } else {
	        return unescape(value[2]);
	    }
	}
});